ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Newt_Population_Manager Class Reference

The class to handle all newt population related matters. More...

#include <Newt_Population_Manager.h>

Inheritance diagram for Newt_Population_Manager:
Population_Manager

Public Member Functions

 Newt_Population_Manager (Landscape *L)
 Newt_Population_Manager Constructor. More...
 
virtual ~Newt_Population_Manager (void)
 Newt_Population_Manager Destructor. More...
 
void CreateObjects (int ob_type, TAnimal *pvo, struct_Newt *data, int number)
 Method for creating a new individual Newt. More...
 
int IsBreedingSeason ()
 Returns whether it is breeding season or not. More...
 
void SetFreeLivingMortChance ()
 Calculate the daily background mortality chance based on weather. More...
 
double GetEggDDRateTransformation (double a_temperature)
 Returns the value from the precalulated m_NewtEgg_DDTempRate to get effective day degrees. More...
 
virtual void TheAOROutputProbe ()
 Special output functionality. More...
 
void RecordAdultProduction (int a_adult)
 Add a new adult to the stats record. More...
 
void RecordEggProduction (int a_eggs)
 Add a new egg production to the stats record. More...
 
void RecordMetamorphosis (int a_age)
 Add a new metamorphosis time to the stats record. More...
 
void InitOutputMetamorphosisStats ()
 Initialises output mean and variance for meatamorphosis times this year. More...
 
void OutputMetamorphosisStats ()
 Output mean and variance for meatamorphosis times this year. More...
 
- Public Member Functions inherited from Population_Manager
 Population_Manager (Landscape *L)
 
virtual ~Population_Manager (void)
 
void SetNoProbes (int a_pn)
 
unsigned GetLiveArraySize (int a_listindex)
 Gets the number of 'live' objects for a list index in the TheArray. More...
 
void IncLiveArraySize (int a_listindex)
 Increments the number of 'live' objects for a list index in the TheArray. More...
 
virtual void Catastrophe (int)
 
unsigned int FarmAnimalCensus (unsigned int a_farm, unsigned int a_typeofanimal)
 
char * SpeciesSpecificReporting (int a_species, int a_time)
 
char * ProbeReport (int a_time)
 
char * ProbeReportTimed (int a_time)
 
void ImpactProbeReport (int a_Time)
 
bool BeginningOfMonth ()
 
void LOG (const char *fname)
 
int SupplyStepSize ()
 
int SupplySimW ()
 
int SupplySimH ()
 
virtual void Run (int NoTSteps)
 
virtual float Probe (int ListIndex, probe_data *p_TheProbe)
 
virtual void ImpactedProbe ()
 
int SupplyListNameLength ()
 
TAnimalSupplyAnimalPtr (int a_index, int a_animal)
 Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK. More...
 
unsigned SupplyListIndexSize ()
 
unsigned SupplyListSize (unsigned listindex)
 
bool CheckXY (int l, int i)
 Debug method to test for out of bounds coordinates. More...
 
const char * SupplyListName (int i)
 
bool IsLast (unsigned listindex)
 
int SupplyState (unsigned listindex, unsigned j)
 
virtual void SupplyLocXY (unsigned listindex, unsigned j, int &x, int &y)
 
const char * SupplyStateNames (int i)
 
unsigned SupplyStateNamesLength ()
 
virtual void DisplayLocations ()
 
int ProbeFileInput (char *p_Filename, int p_ProbeNo)
 
TAnimalFindClosest (int x, int y, unsigned Type)
 
bool OpenTheRipleysOutputProbe (string a_NWordFilename)
 
void OpenTheAOROutputProbe (string a_AORFilename)
 
bool OpenTheMonthlyRipleysOutputProbe ()
 
bool OpenTheReallyBigProbe ()
 
virtual void TheRipleysOutputProbe (FILE *a_prb)
 
virtual void TheReallyBigOutputProbe ()
 
void CloseTheMonthlyRipleysOutputProbe ()
 
virtual void CloseTheRipleysOutputProbe ()
 
virtual void CloseTheReallyBigOutputProbe ()
 
TTypesOfPopulation GetPopulationType ()
 
int GetSeasonNumber ()
 Get the season number. More...
 
void LamdaDeath (int x, int y)
 
void LamdaBirth (int x, int y)
 
void LamdaBirth (int x, int y, int z)
 
void LamdaClear ()
 
void LamdaDumpOutput ()
 
virtual int SupplyPegPosx (int)
 
virtual int SupplyPegPosy (int)
 
virtual int SupplyCovPosx (int)
 
virtual int SupplyCovPosy (int)
 
virtual bool OpenTheFledgelingProbe ()
 
virtual bool OpenTheBreedingPairsProbe ()
 
virtual bool OpenTheBreedingSuccessProbe ()
 
virtual void BreedingPairsOutput (int)
 
virtual int TheBreedingFemalesProbe (int)
 
virtual int TheFledgelingProbe ()
 
virtual void BreedingSuccessProbeOutput (double, int, int, int, int, int, int, int)
 
virtual int TheBreedingSuccessProbe (int &, int &, int &, int &, int &, int &)
 
virtual void FledgelingProbeOutput (int, int)
 
virtual void TheGeneticProbe (unsigned, int, unsigned &)
 
virtual void GeneticsResultsOutput (FILE *, unsigned)
 

Protected Member Functions

virtual void DoFirst ()
 Things to do before anything else at the start of a timestep
More...
 
void SetUnsetBreedingSeason ()
 Controls when it is breeding season
More...
 
- Protected Member Functions inherited from Population_Manager
virtual bool StepFinished ()
 Overrides the population manager StepFinished - there is no chance that hunters do not finish a step behaviour. More...
 
virtual void DoBefore ()
 
virtual void DoAfter ()
 
virtual void DoAlmostLast ()
 
virtual void DoLast ()
 
void EmptyTheArray ()
 Removes all objects from the TheArray by deleting them and clearing TheArray. More...
 
void SortX (unsigned Type)
 
void SortXIndex (unsigned Type)
 
void SortY (unsigned Type)
 
void SortState (unsigned Type)
 
void SortStateR (unsigned Type)
 
unsigned PartitionLiveDead (unsigned Type)
 
void Shuffle_or_Sort (unsigned Type)
 
void Shuffle (unsigned Type)
 
virtual void Catastrophe ()
 

Protected Attributes

int m_BreedingSeasonFlag
 Set to 0 when it is newt breeding season, then records the number of days after. More...
 
double m_NewtEgg_DDTempRate [31]
 An array to hold a precalulated day-degree rate transformation for egg development. More...
 
SimpleStatistics m_NewtMetamorphosisStats
 A class for holding the stats on newt metamorphosis development times. More...
 
SimpleStatistics m_NewtEggProdStats
 A class for holding the stats on newt egg production. More...
 
SimpleStatistics m_NewtAdultProdStats
 A class for holding the stats on newt adult production. More...
 
- Protected Attributes inherited from Population_Manager
vector< unsigned > m_LiveArraySize
 
int m_NoProbes
 
AOR_Probem_AOR_Probe
 
FILE * m_GeneticsFile
 
FILE * m_AlleleFreqsFile
 
FILE * m_EasyPopRes
 
const char * StateNames [100]
 
int m_catastrophestartyear
 
int m_StepSize
 
vector< TListOfAnimalsTheArray
 
unsigned StateNamesLength
 
const char * m_ListNames [32]
 
unsigned m_ListNameLength
 
FILE * TestFile
 
FILE * TestFile2
 
unsigned BeforeStepActions [12]
 
int m_SeasonNumber
 Holds the season number. Used when running goose and hunter sims. More...
 
TTypesOfPopulation m_population_type
 
ofstream * AOROutputPrb
 
FILE * RipleysOutputPrb
 
FILE * RipleysOutputPrb1
 
FILE * RipleysOutputPrb2
 
FILE * RipleysOutputPrb3
 
FILE * RipleysOutputPrb4
 
FILE * RipleysOutputPrb5
 
FILE * RipleysOutputPrb6
 
FILE * RipleysOutputPrb7
 
FILE * RipleysOutputPrb8
 
FILE * RipleysOutputPrb9
 
FILE * RipleysOutputPrb10
 
FILE * RipleysOutputPrb11
 
FILE * RipleysOutputPrb12
 
FILE * ReallyBigOutputPrb
 
long int lamdagrid [2][257][257]
 

Additional Inherited Members

- Public Attributes inherited from Population_Manager
int IndexArrayX [5][10000]
 
probe_dataTheProbe [100]
 
int SimH
 
int SimW
 
unsigned SimHH
 
unsigned SimWH
 
char m_SimulationName [255]
 
bool ProbesSet
 
Landscapem_TheLandscape
 

Detailed Description

The class to handle all newt population related matters.

Constructor & Destructor Documentation

◆ Newt_Population_Manager()

Newt_Population_Manager::Newt_Population_Manager ( Landscape L)

Newt_Population_Manager Constructor.

This class takes care of newt object creation and any list management methods. This is handled by In addition the newt population managner must control the breeding season flag, done in SetUnsetBreedingSeason

198  : Population_Manager(L) {
199  // Load List of Animal Classes
200  m_ListNames[0] = "Newt_Egg";
201  m_ListNames[1] = "Newt_Larva";
202  m_ListNames[2] = "Newt_Juvenile";
203  m_ListNames[3] = "Newt_Male";
204  m_ListNames[4] = "Newt_Female";
205  m_ListNameLength = 5;
206  // We need one vector for each life stage
207  for (unsigned int i = 0; i < (10 - m_ListNameLength); i++) {
208  TheArray.pop_back();
209  }
210  strcpy(m_SimulationName, "Newt Simulation");
211  // Assign the correct values to static variables
247  Newt_Adult::m_newtadultwalkspeed = cfg_NewtWalkSpeed.value() / 10; // 1/ 10th of the juvenile following Karlsson et al( 2007 )
254  // Create any precalculated data arrays
255  for (int i = 1; i < 30; i++) {
257  double b = a / double(i);
258  m_NewtEgg_DDTempRate[i] = (cfg_NewtEggDevelTotal.value() / b) / double(i);
259  }
260  m_NewtEgg_DDTempRate[0] = 0.0;
261  m_NewtEgg_DDTempRate[30] = 0.0;
262  // Create some animals
263  struct_Newt* sp;
264  sp = new struct_Newt;
265  sp->NPM = this;
266  sp->L = m_TheLandscape;
267  sp->age = 365;
268  sp->reproinhib = false;
269  for (int i = 0; i < cfg_newt_startnumber.value(); i++) {
270  int pref = m_TheLandscape->SupplyRandomPondRef();
271  sp->x = m_TheLandscape->SupplyCentroidX(pref);
272  sp->y = m_TheLandscape->SupplyCentroidY(pref);
273  if (m_TheLandscape->SupplyElementType(sp->x, sp->y) != tole_Pond) {
274  g_msg->Warn("Centroid not in Pond.Pond ref : ", pref);
275  exit(0);
276  }
277  sp->pondrefs.resize(1);
278  sp->pondrefs[0] = m_TheLandscape->SupplyPondIndex(pref);
279  // test if this is a pond, if so create a male and female
280  CreateObjects(tton_Male, NULL, sp, 1);
281  CreateObjects(tton_Female, NULL, sp, 1);
282  }
283  // Now we must the set the in pond flag for all newly created newts (because we put them in a pond)
284  int sz = int( GetLiveArraySize( tton_Male ) );
285  for (int i = 0; i < sz; i++) {
286  dynamic_cast<Newt_Male*>(TheArray[tton_Male][i])->SetInPond();
287  }
288  sz = int( GetLiveArraySize( tton_Female ) );
289  for (int i = 0; i < sz; i++) {
290  dynamic_cast<Newt_Female*>(TheArray[tton_Female][i])->SetInPond();
291  }
292  // Set any variable values that are needed on start-up
294  // Set up any output needed
295 #ifdef __RECORDNEWTMETAMORPHOSIS
297 #endif
300  }
303  }
304  else ReallyBigOutputPrb = 0;
305 }
@ tton_Female
Definition: Newt.h:53
@ tton_Male
Definition: Newt.h:52
static CfgFloat cfg_NewtAdultPPPToxEliminationRate("NEWT_ADULT_PPP_TOX_ELIMINATIONRATE", CFG_CUSTOM, 0.0)
Pesticide input parameter - One minus the proportion of internal PPP eliminated each day in adult new...
static CfgInt cfg_newteggproductionvolume("NEWT_EGGPRODUCTIONVOLUME", CFG_CUSTOM, 100)
Newt model input parameter - Total number of eggs produced per breeding season Default value is 200 b...
static CfgFloat cfg_NewtEggPPPToxEliminationRate("NEWT_EGG_PPP_TOX_ELIMINATIONRATE", CFG_CUSTOM, 0.0)
Pesticide input parameter - One minus the proportion of internal PPP eliminated each day in embryonic...
static CfgFloat cfg_NewtLarvaPPPToxEliminationRate("NEWT_LARVA_PPP_TOX_ELIMINATIONRATE", CFG_CUSTOM, 0.0)
Pesticide input parameter - One minus the proportion of internal PPP eliminated each day in larval ne...
static CfgFloat cfg_NewtJuvenilePPPEffectProbability_Overspray("NEWT_JUV_PPP_TOX_EFFECTPROBABILITY_OVERSPRAY", CFG_CUSTOM, 0.0)
Pesticide input parameter - daily probability of mortality if above a trigger dose.
static CfgFloat cfg_LarvalFoodProportion("NEWT_LARVALFOODPROPCONST", CFG_CUSTOM, 0.01)
Newt model input parameter - This multiplied by its age is the larval food consumption g of food per ...
static CfgFloat cfg_NewtEggPPPToxTrigger("NEWT_EGG_PPP_TOX_TRIGGER", CFG_CUSTOM, 9999.999)
Pesticide input parameter - the mg of pesticicde assumed to trigger a response in embryonic newts.
static CfgFloat cfg_NewtJuvenilePPPEffectProbability_EnvConc("NEWT_JUV_PPP_TOX_EFFECTPROBABILITY_ENVCONC", CFG_CUSTOM, 0.0)
Pesticide input parameter - daily probability of mortality if above a trigger dose.
static CfgBool cfg_Newt_Test_Pesticide_Egg("NEWT_TEST_PESTICIDE_EGG", CFG_CUSTOM, false)
Denotes whether pesticide testing mode is active for eggs - needs to be set to true to evaluate PPP i...
static CfgFloat cfg_NewtAdultPPPToxTrigger("NEWT_ADULT_PPP_TOX_TRIGGER", CFG_CUSTOM, 9999.999)
Pesticide input parameter - the mg of pesticicde assumed to trigger a response in adult newts.
static CfgFloat cfg_NewtLarvaDevelThresholdTime("NEWT_LARVA_DEVELTHRESHOLDTIME", CFG_CUSTOM, 12 *7)
Newt model input parameter - the development time at which the larva will undergo metamorphosis if it...
static CfgInt cfg_newtdailyeggproductionvolume("NEWT_EGGDAILYPRODUCTIONVOLUME", CFG_CUSTOM, 5)
Newt model input parameter - The number of eggs laid per day when breeding. Estimated based on Langto...
static CfgFloat cfg_NewtEggDevelTotal("NEWT_EGG_DEVELTOTAL", CFG_CUSTOM, 900)
Newt model input parameter - The sum of day degrees above NEWT_EGG_DEVELTHRESHOLD before an egg hatch...
static CfgFloat cfg_NewtJuvenilePPPToxTrigger_Overspray("NEWT_JUVENILE_PPP_TOX_TRIGGER_ENVCONC", CFG_CUSTOM, 9999.999)
Pesticide input parameter - the mg of pesticicde assumed to trigger a response in juvenile newts for ...
static CfgFloat cfg_NewtLarvaPPPEffectProbability("NEWT_LARVA_PPP_TOX_EFFECTPROBABILITY", CFG_CUSTOM, 0.0)
Pesticide input parameter - daily probability of mortality if above a trigger dose.
CfgBool cfg_ReallyBigOutput_used
static CfgInt cfg_NewtWalkStepsize("NEWT_WALKSSTEPSIZE", CFG_CUSTOM, 1)
Newt model input parameter - This is the step size the newt can take in the model (can be set >1 to s...
static CfgFloat cfg_NewtAdultPPPEffectProbability("NEWT_ADULT_PPP_TOX_EFFECTPROBABILITY", CFG_CUSTOM, 0.0)
Pesticide input parameter - daily probability of mortality if above a trigger dose.
static CfgFloat cfg_newtdormancytemp("NEWT_DORMANCYTEMP", CFG_CUSTOM, 22.5)
Newt model input parameter - The temperature at which freeliving stages are dormant (do not move more...
static CfgInt cfg_NewtWalkSpeed("ENWT_WALKSPEED", CFG_CUSTOM, 20)
Newt model input parameter - This is the number of m moved per day.
static CfgFloat cfg_NewtLarvaMortalityChance("NEWT_LARVAL_MORTALITYCHANCE", CFG_CUSTOM, 0.015)
Newt model input parameter - Daily larval mortality probability, excluding density dependent mortalit...
static CfgFloat cfg_newtdormancyhumidity("NEWT_DORMANCYHUMIDITY", CFG_CUSTOM, 0.003125)
Newt model input parameter - The preciptitation needed for newt movement (over last two days)
static CfgFloat cfg_NewtJuvenilePPPToxTrigger_EnvConc("NEWT_JUVENILE_PPP_TOX_TRIGGER_ENVCONC", CFG_CUSTOM, 9999.999)
Pesticide input parameter - the mg of pesticicde assumed to trigger a response in juvenile newts.
static CfgBool cfg_Newt_Test_Pesticide_Larva("NEWT_TEST_PESTICIDE_LARVA", CFG_CUSTOM, false)
Denotes whether pesticide testing mode is active for larvae - needs to be set to true to evaluate PPP...
static CfgFloat cfg_NewtLarvaDevelThresholdUpperSz("NEWT_LARVA_DEVELTHRESHOLDUPPERSZ", CFG_CUSTOM, 42.3)
Newt model input parameter - the upper size at which larvae will undergo metamorphosis.
static CfgFloat cfg_NewtEggPPPEffectProbability("NEWT_EGG_PPP_TOX_EFFECTPROBABILITY", CFG_CUSTOM, 0.0)
Pesticide input parameter - daily probability of mortality if above a trigger dose.
static CfgFloat cfg_NewtLarvaDailyGrowthIncrement("NEWT_LARVA_DAILYGROWTHINCREMENT", CFG_CUSTOM,(42.3 - 1.0)/(12 *7.0))
Newt model input parameter - the daily increment assuming a linear growth model to the juvenile start...
static CfgFloat cfg_NewtJuvenilePPPToxEliminationRate("NEWT_JUVENILE_PPP_TOX_ELIMINATIONRATE", CFG_CUSTOM, 0.0)
Pesticide input parameter - One minus the proportion of internal PPP eliminated each day in juvenile ...
static CfgFloat cfg_NewtLarvaPPPToxTrigger("NEWT_LARVA_PPP_TOX_TRIGGER", CFG_CUSTOM, 9999.999)
Pesticide input parameter - the mg of pesticicde assumed to trigger a response in larval newts.
static CfgInt cfg_newt_startnumber("NEWT_STARTNUMBER", CFG_CUSTOM, 1000)
The starting numbers for male and female newts.
static CfgFloat cfg_NewtJuvenileDailyLengthGain("NEWT_JUVENILEDAILYLENGTHGAIN", CFG_CUSTOM, 0.047827)
Newt model input parameter - If temperature is above the NEWT_DORMANCYTEMP the newt grows by this man...
CfgBool cfg_RipleysOutput_used
static CfgFloat cfg_newtpoorhabitatdispersalprob("NEWT_POORHABITATDISPPROB", CFG_CUSTOM, 1.0)
Newt model input parameter - The daily probability of dispersal in poor habitat if weather is suitabl...
static CfgFloat cfg_NewtLarvaDevelThresholdLowerSz("NEWT_LARVA_DEVELTHRESHOLDLOWERSZ", CFG_CUSTOM, 42.3)
Newt model input parameter - the lower size at which larvae CANNOT undergo metamorphosis.
static CfgFloat cfg_NewtJuvenileDevelSize("NEWT_JUVENILE_DEVELSIZE", CFG_CUSTOM, 42.0+21.9)
Newt model input parameter - the length needed to be achieved before a juvenile matures,...
static CfgFloat cfg_newtgoodhabitatdispersalprob("NEWT_GOODHABITATDISPPROB", CFG_CUSTOM, 0.25, 0.0, 1.0)
Newt model input parameter - The daily probability of dispersal in good habitat if weather is suitabl...
static CfgFloat cfg_NewtEggMortalityChance("NEWT_EGG_MORTALITYCHANCE", CFG_CUSTOM, 0.048)
Newt model input parameter - Daily egg mortality probability, fitted to 75% mortality by 4 weeks.
static CfgFloat cfg_NewtEggDevelDDParameter("NEWT_EGG_DEVELDDPARAMETER", CFG_CUSTOM, -0.534)
Newt model input parameter - The temperature slope for egg development change with temperature....
static CfgFloat cfg_NewtRoadMortalityProb("NEWT_ROADMORTALITYPROB", CFG_CUSTOM, 0.9/18.0)
Newt model input parameter - Chance of mortality per road crossing (0.45 for typical road,...
static CfgBool cfg_Newt_Test_Pesticide_Terrestrial("NEWT_TEST_PESTICIDE_TERRESTRIAL", CFG_CUSTOM, false)
Denotes whether pesticide testing mode is active for adults - needs to be set to true to evaluate PPP...
bool value(void)
Definition: configurator.h:135
double value(void)
Definition: configurator.h:118
int value(void)
Definition: configurator.h:98
int SupplySimAreaHeight(void)
Definition: landscape.h:1637
int SupplyCentroidY(int a_polyref)
Definition: landscape.h:473
int SupplyPondIndex(int a_pondref)
Returns the index of a pond based on pondref or -1 if not found.
Definition: landscape.h:342
int SupplyRandomPondRef()
Returns random pond polyref.
Definition: Landscape.cpp:2610
int SupplySimAreaWidth(void)
Definition: landscape.h:1632
int SupplyCentroidX(int a_polyref)
Definition: landscape.h:470
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Definition: landscape.h:1110
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
static double m_AdultPPPElimRate
The daily proportion of PPP body burden that is not eliminated for adults.
Definition: Newt.h:413
static double m_AdultPPPThreshold
The threshold for effect of PPP on adults.
Definition: Newt.h:411
static int m_newtadultwalkspeed
The max walking speed of a newt.
Definition: Newt.h:419
static double m_AdultPPPEffectProbability
The daily probability of effect if above m_AdultPPPThreshold for adults.
Definition: Newt.h:415
static double m_EggDevelopmentDDTotal
Definition: Newt.h:99
static bool m_test_pesticide_egg
Flags to record whether we are in pesticide testing mode.
Definition: Newt.h:106
static bool m_test_pesticide_terrestrial
Definition: Newt.h:108
static double m_EggMortalityChance
Definition: Newt.h:102
static double m_JuvenileDevelopmentSize
Definition: Newt.h:101
static double m_EggDevelopmentDDParameter
Definition: Newt.h:100
static bool m_test_pesticide_larva
Definition: Newt.h:107
static double m_EggPPPEffectProbability
The daily probability of effect if above m_EggPPPThreshold for eggs.
Definition: Newt.h:200
static double m_EggPPPElimRate
The daily proportion of PPP body burden that is not eliminated for eggs.
Definition: Newt.h:198
static double m_EggPPPThreshold
The threshold for effect of PPP on eggs.
Definition: Newt.h:196
The newt female class.
Definition: Newt.h:489
static unsigned m_eggdailyproductionvolume
Parameter - holds the number of eggs produced per day during breeding.
Definition: Newt.h:503
static unsigned m_eggproductionvolume
Parameter - holds the max number of eggs that can be produced during breeding.
Definition: Newt.h:501
static int m_SimW
The width of the simulation map, stored for fast access.
Definition: Newt.h:324
static double m_roadmortalityprob
The probability of death when crossing a road.
Definition: Newt.h:328
static double m_JuvenilePPPElimRate
The daily proportion of PPP body burden that is not eliminated for juveniles.
Definition: Newt.h:316
static double m_JuvenilePPPEffectProbability_EnvConc
The daily probability of effect if above m_JuvenilePPPThreshold for juveniles for environmental conce...
Definition: Newt.h:318
static int m_newtwalkstepsize
The size of a step when evaluating habitat during walking.
Definition: Newt.h:332
static double m_JuvenilePPPThreshold_Overspray
The overspray threshold for effect of PPP on juveniles.
Definition: Newt.h:314
static double m_JuvenilePPPEffectProbability_Overspray
The daily probability of effect if above m_JuvenilePPPThreshold for juveniles for overspray.
Definition: Newt.h:320
static double m_poorhabitatdispersalprob
Probability of dispersal in poor habitat.
Definition: Newt.h:336
static int m_newtwalkspeed
The max walking speed of a newt.
Definition: Newt.h:330
static double m_NewtDormancyHumidity
Temperature in degrees that the newts become dormant.
Definition: Newt.h:340
static double m_JuvenilePPPThreshold_EnvConc
The environmental concentration threshold for effect of PPP on juveniles.
Definition: Newt.h:312
static double m_JuvenileDailyWeightGain
Used in determining daily growth.
Definition: Newt.h:322
static double m_JuvenilePPPThreshold_Min
The minimum threshold for effect of PPP on juveniles.
Definition: Newt.h:310
static int m_SimH
The height of the simulation map, stored for fast access.
Definition: Newt.h:326
static double m_goodhabitatdispersalprob
Probability of dispersal in good habitat.
Definition: Newt.h:334
static double m_NewtDormancyTemperature
Temperature in degrees that the newts become dormant.
Definition: Newt.h:338
static double m_LarvaDevelopmentTime
The time before a larva can undergo metamorphosis.
Definition: Newt.h:249
static double m_LarvaDevelopmentUpperSz
The upper size at which larvae will undergo metamorphosis.
Definition: Newt.h:245
static double m_LarvaPPPThreshold
The threshold for effect of PPP on larvae.
Definition: Newt.h:237
static double m_NewtLarvaDailyGrowthIncrement
The daily growth increment if a larva survives to grow that day.
Definition: Newt.h:251
static double m_LarvaPPPElimRate
The daily proportion of PPP body burden that is not eliminated for larvae.
Definition: Newt.h:239
static double m_LarvaMortalityChance
The daily probability of death from unspecified causes for a larva.
Definition: Newt.h:253
static double m_LarvaDevelopmentLowerSz
The lower size below which larvae cannot undergo metamorphosis.
Definition: Newt.h:247
static double m_LarvaPPPEffectProbability
The daily probability of effect if above m_LarvaPPPThreshold for larvae.
Definition: Newt.h:241
static double m_LarvalFoodProportion
Holds the parameter value for the proportion of food eaten per day relative to size.
Definition: Newt.h:243
The newt male class.
Definition: Newt.h:461
double m_NewtEgg_DDTempRate[31]
An array to hold a precalulated day-degree rate transformation for egg development.
Definition: Newt_Population_Manager.h:119
void InitOutputMetamorphosisStats()
Initialises output mean and variance for meatamorphosis times this year.
Definition: Newt_Population_Manager.cpp:474
int m_BreedingSeasonFlag
Set to 0 when it is newt breeding season, then records the number of days after.
Definition: Newt_Population_Manager.h:117
void CreateObjects(int ob_type, TAnimal *pvo, struct_Newt *data, int number)
Method for creating a new individual Newt.
Definition: Newt_Population_Manager.cpp:344
FILE * ReallyBigOutputPrb
Definition: PopulationManager.h:595
const char * m_ListNames[32]
Definition: PopulationManager.h:537
char m_SimulationName[255]
Definition: PopulationManager.h:513
Population_Manager(Landscape *L)
Definition: PopulationManager.cpp:221
bool OpenTheRipleysOutputProbe(string a_NWordFilename)
Definition: PopulationManager.cpp:757
unsigned m_ListNameLength
Definition: PopulationManager.h:538
vector< TListOfAnimals > TheArray
Definition: PopulationManager.h:534
unsigned GetLiveArraySize(int a_listindex)
Gets the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:433
bool OpenTheReallyBigProbe()
Definition: PopulationManager.cpp:859
Landscape * m_TheLandscape
Definition: PopulationManager.h:515
Used for creation of a new Newt object.
Definition: Newt_Population_Manager.h:47
bool reproinhib
Holds a reproductive effect flag.
Definition: Newt_Population_Manager.h:64
vector< unsigned > pondrefs
Born x-coord.
Definition: Newt_Population_Manager.h:56
int y
y-coord
Definition: Newt_Population_Manager.h:54
int age
The newt age.
Definition: Newt_Population_Manager.h:50
int x
x-coord
Definition: Newt_Population_Manager.h:52
Landscape * L
Landscape pointer.
Definition: Newt_Population_Manager.h:60
Newt_Population_Manager * NPM
Newt_Population_Manager pointer.
Definition: Newt_Population_Manager.h:62
class MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41
@ tole_Pond
Definition: tole_declaration.h:101

References struct_Newt::age, cfg_LarvalFoodProportion, cfg_newt_startnumber, cfg_Newt_Test_Pesticide_Egg, cfg_Newt_Test_Pesticide_Larva, cfg_Newt_Test_Pesticide_Terrestrial, cfg_NewtAdultPPPEffectProbability, cfg_NewtAdultPPPToxEliminationRate, cfg_NewtAdultPPPToxTrigger, cfg_newtdailyeggproductionvolume, cfg_newtdormancyhumidity, cfg_newtdormancytemp, cfg_NewtEggDevelDDParameter, cfg_NewtEggDevelTotal, cfg_NewtEggMortalityChance, cfg_NewtEggPPPEffectProbability, cfg_NewtEggPPPToxEliminationRate, cfg_NewtEggPPPToxTrigger, cfg_newteggproductionvolume, cfg_newtgoodhabitatdispersalprob, cfg_NewtJuvenileDailyLengthGain, cfg_NewtJuvenileDevelSize, cfg_NewtJuvenilePPPEffectProbability_EnvConc, cfg_NewtJuvenilePPPEffectProbability_Overspray, cfg_NewtJuvenilePPPToxEliminationRate, cfg_NewtJuvenilePPPToxTrigger_EnvConc, cfg_NewtJuvenilePPPToxTrigger_Overspray, cfg_NewtLarvaDailyGrowthIncrement, cfg_NewtLarvaDevelThresholdLowerSz, cfg_NewtLarvaDevelThresholdTime, cfg_NewtLarvaDevelThresholdUpperSz, cfg_NewtLarvaMortalityChance, cfg_NewtLarvaPPPEffectProbability, cfg_NewtLarvaPPPToxEliminationRate, cfg_NewtLarvaPPPToxTrigger, cfg_newtpoorhabitatdispersalprob, cfg_NewtRoadMortalityProb, cfg_NewtWalkSpeed, cfg_NewtWalkStepsize, cfg_ReallyBigOutput_used, cfg_RipleysOutput_used, CreateObjects(), g_msg, Population_Manager::GetLiveArraySize(), InitOutputMetamorphosisStats(), struct_Newt::L, Newt_Adult::m_AdultPPPEffectProbability, Newt_Adult::m_AdultPPPElimRate, Newt_Adult::m_AdultPPPThreshold, m_BreedingSeasonFlag, Newt_Female::m_eggdailyproductionvolume, Newt_Base::m_EggDevelopmentDDParameter, Newt_Base::m_EggDevelopmentDDTotal, Newt_Base::m_EggMortalityChance, Newt_Egg::m_EggPPPEffectProbability, Newt_Egg::m_EggPPPElimRate, Newt_Egg::m_EggPPPThreshold, Newt_Female::m_eggproductionvolume, Newt_Juvenile::m_goodhabitatdispersalprob, Newt_Juvenile::m_JuvenileDailyWeightGain, Newt_Base::m_JuvenileDevelopmentSize, Newt_Juvenile::m_JuvenilePPPEffectProbability_EnvConc, Newt_Juvenile::m_JuvenilePPPEffectProbability_Overspray, Newt_Juvenile::m_JuvenilePPPElimRate, Newt_Juvenile::m_JuvenilePPPThreshold_EnvConc, Newt_Juvenile::m_JuvenilePPPThreshold_Min, Newt_Juvenile::m_JuvenilePPPThreshold_Overspray, Newt_Larva::m_LarvaDevelopmentLowerSz, Newt_Larva::m_LarvaDevelopmentTime, Newt_Larva::m_LarvaDevelopmentUpperSz, Newt_Larva::m_LarvalFoodProportion, Newt_Larva::m_LarvaMortalityChance, Newt_Larva::m_LarvaPPPEffectProbability, Newt_Larva::m_LarvaPPPElimRate, Newt_Larva::m_LarvaPPPThreshold, Population_Manager::m_ListNameLength, Population_Manager::m_ListNames, Newt_Adult::m_newtadultwalkspeed, Newt_Juvenile::m_NewtDormancyHumidity, Newt_Juvenile::m_NewtDormancyTemperature, m_NewtEgg_DDTempRate, Newt_Larva::m_NewtLarvaDailyGrowthIncrement, Newt_Juvenile::m_newtwalkspeed, Newt_Juvenile::m_newtwalkstepsize, Newt_Juvenile::m_poorhabitatdispersalprob, Newt_Juvenile::m_roadmortalityprob, Newt_Juvenile::m_SimH, Population_Manager::m_SimulationName, Newt_Juvenile::m_SimW, Newt_Base::m_test_pesticide_egg, Newt_Base::m_test_pesticide_larva, Newt_Base::m_test_pesticide_terrestrial, Population_Manager::m_TheLandscape, struct_Newt::NPM, Population_Manager::OpenTheReallyBigProbe(), Population_Manager::OpenTheRipleysOutputProbe(), struct_Newt::pondrefs, Population_Manager::ReallyBigOutputPrb, struct_Newt::reproinhib, Landscape::SupplyCentroidX(), Landscape::SupplyCentroidY(), Landscape::SupplyElementType(), Landscape::SupplyPondIndex(), Landscape::SupplyRandomPondRef(), Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), Population_Manager::TheArray, tole_Pond, tton_Female, tton_Male, CfgInt::value(), CfgFloat::value(), CfgBool::value(), MapErrorMsg::Warn(), struct_Newt::x, and struct_Newt::y.

◆ ~Newt_Population_Manager()

Newt_Population_Manager::~Newt_Population_Manager ( void  )
virtual

Newt_Population_Manager Destructor.

193  {
194  // Should all be done by the Population_Manager destructor
195 }

Member Function Documentation

◆ CreateObjects()

void Newt_Population_Manager::CreateObjects ( int  ob_type,
TAnimal pvo,
struct_Newt data,
int  number 
)

Method for creating a new individual Newt.

344  {
345  Newt_Egg* new_Newt_Egg;
346  Newt_Larva* new_Newt_Larva;
347  Newt_Juvenile* new_Newt_Juvenile;
348  Newt_Male* new_Newt_Male;
349  Newt_Female* new_Newt_Female;
350 #ifdef __RECORDNEWTMETAMORPHOSIS
351  if (ob_type == tton_Egg) RecordEggProduction(number);
352 #endif
353  for (int i = 0; i < number; i++) {
354  switch (ob_type) {
355  case tton_Egg:
356  if (unsigned(TheArray[ob_type].size())>GetLiveArraySize(ob_type)) {
357  // We need to reuse an object
358  dynamic_cast<Newt_Egg*>(TheArray[ob_type][GetLiveArraySize(ob_type)])->ReInit(data->x, data->y, data->pondrefs, data->L, data->NPM, false);
359  IncLiveArraySize(ob_type);
360  }
361  else {
362  new_Newt_Egg = new Newt_Egg(data->x, data->y, data->pondrefs, data->L, data->NPM, false);
363  TheArray[ob_type].push_back(new_Newt_Egg);
364  IncLiveArraySize(ob_type);
365  }
366  break;
367  case tton_Larva:
368  if (unsigned(TheArray[ob_type].size()) > GetLiveArraySize(ob_type)) {
369  // We need to reuse an object
370  new_Newt_Larva = dynamic_cast<Newt_Larva*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
371  new_Newt_Larva->ReInit(data->x, data->y, data->pondrefs, data->L, data->NPM, data->age, data->reproinhib);
372  new_Newt_Larva->SetAge(data->age);
373  }
374  else {
375  new_Newt_Larva = new Newt_Larva(data->x, data->y, data->pondrefs, data->L, data->NPM, data->age, data->reproinhib);
376  TheArray[ob_type].push_back(new_Newt_Larva);
377  new_Newt_Larva->SetAge(data->age);
378  }
379  IncLiveArraySize(ob_type);
380  break;
381  case tton_Juvenile:
382  if (unsigned(TheArray[ob_type].size()) > GetLiveArraySize(ob_type)) {
383  // We need to reuse an object
384  new_Newt_Juvenile = dynamic_cast<Newt_Juvenile*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
385  new_Newt_Juvenile->ReInit(data->x, data->y, data->pondrefs, data->L, data->NPM, data->age, data->reproinhib);
386  new_Newt_Juvenile->SetAge(data->age);
387  }
388  else {
389  new_Newt_Juvenile = new Newt_Juvenile(data->x, data->y, data->pondrefs, data->L, data->NPM, data->age, data->reproinhib);
390  new_Newt_Juvenile->SetAge(data->age);
391  TheArray[ob_type].push_back(new_Newt_Juvenile);
392  }
393  IncLiveArraySize(ob_type);
394  break;
395  case tton_Male:
396  if (unsigned(TheArray[ob_type].size()) > GetLiveArraySize(ob_type)) {
397  // We need to reuse an object
398  new_Newt_Male = dynamic_cast<Newt_Male*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
399  new_Newt_Male->ReInit(data->x, data->y, data->pondrefs, data->L, data->NPM, data->age, data->reproinhib);
400  new_Newt_Male->SetAge(data->age);
401  new_Newt_Male->SetWeight(data->weight);
402  }
403  else {
404  new_Newt_Male = new Newt_Male(data->x, data->y, data->pondrefs, data->L, data->NPM, data->age, data->reproinhib);
405  new_Newt_Male->SetAge(data->age);
406  new_Newt_Male->SetWeight(data->weight);
407  TheArray[ob_type].push_back(new_Newt_Male);
408  }
409  IncLiveArraySize(ob_type);
410  break;
411  case tton_Female:
412  if (unsigned(TheArray[ob_type].size()) > GetLiveArraySize(ob_type)) {
413  // We need to reuse an object
414  new_Newt_Female = dynamic_cast<Newt_Female*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
415  new_Newt_Female->ReInit(data->x, data->y, data->pondrefs, data->L, data->NPM, data->age, data->reproinhib);
416  new_Newt_Female->SetAge(data->age);
417  new_Newt_Female->SetWeight(data->weight);
418  }
419  else {
420  new_Newt_Female = new Newt_Female(data->x, data->y, data->pondrefs, data->L, data->NPM, data->age, data->reproinhib);
421  new_Newt_Female->SetAge(data->age);
422  new_Newt_Female->SetWeight(data->weight);
423  TheArray[ob_type].push_back(new_Newt_Female);
424  }
425  IncLiveArraySize(ob_type);
426  break;
427  }
428  }
429 }
@ tton_Larva
Definition: Newt.h:50
@ tton_Juvenile
Definition: Newt.h:51
@ tton_Egg
Definition: Newt.h:49
void SetAge(unsigned a_age)
A typical interface function - this one sets the Age as an unsigned integer.
Definition: Newt.h:165
The newt egg class - in pond.
Definition: Newt.h:188
virtual void ReInit(int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib)
Used to re-use an object - must be implemented in descendent classes.
Definition: Newt.cpp:999
The newt juvenile class - free living but not reproductive.
Definition: Newt.h:280
void SetWeight(double a_weight)
Set method for m_weight.
Definition: Newt.h:355
virtual void ReInit(int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib)
Used to re-use an object - must be implemented in descendent classes.
Definition: Newt.cpp:344
The newt larva class - in pond.
Definition: Newt.h:224
void ReInit(int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib)
ReInit for object pool.
Definition: Newt.cpp:218
virtual void ReInit(int a_x, int a_y, vector< unsigned > a_pond, Landscape *a_L, Newt_Population_Manager *a_NPM, unsigned a_age, bool a_reproinhib)
Used to re-use an object - must be implemented in descendent classes.
Definition: Newt.cpp:901
void RecordEggProduction(int a_eggs)
Add a new egg production to the stats record.
Definition: Newt_Population_Manager.cpp:462
void IncLiveArraySize(int a_listindex)
Increments the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:437
double weight
Newt weight.
Definition: Newt_Population_Manager.h:58

References struct_Newt::age, Population_Manager::GetLiveArraySize(), Population_Manager::IncLiveArraySize(), struct_Newt::L, struct_Newt::NPM, struct_Newt::pondrefs, RecordEggProduction(), Newt_Larva::ReInit(), Newt_Juvenile::ReInit(), Newt_Male::ReInit(), Newt_Female::ReInit(), struct_Newt::reproinhib, Newt_Base::SetAge(), Newt_Juvenile::SetWeight(), Population_Manager::TheArray, tton_Egg, tton_Female, tton_Juvenile, tton_Larva, tton_Male, struct_Newt::weight, struct_Newt::x, and struct_Newt::y.

Referenced by Newt_Population_Manager(), Newt_Female::st_Breed(), Newt_Egg::st_NextStage(), Newt_Larva::st_NextStage(), and Newt_Juvenile::st_NextStage().

◆ DoFirst()

void Newt_Population_Manager::DoFirst ( void  )
protectedvirtual

Things to do before anything else at the start of a timestep

Reimplemented from Population_Manager.

432  {
433  int today = m_TheLandscape->SupplyDayInYear();
435  else if (today >= cfg_breedingseasonend.value()) m_BreedingSeasonFlag++;
436  if (today == 1) {
437  int sz = int( GetLiveArraySize( tton_Female ) );
438  for (int i = 0; i < sz; i++) {
439  dynamic_cast<Newt_Female*>(TheArray[tton_Female][i])->ResetEggProduction();
440  }
441  }
443 #ifdef __RECORDNEWTMETAMORPHOSIS
444  if (today == 364) {
446  }
447 #endif
448 }
static CfgInt cfg_breedingseasonstart("NEWT_BREEDINGSEASONSTART", CFG_CUSTOM, March)
Newt model input parameter - First possible breeding season date Griffiths et al (2010) & Langton et ...
static CfgInt cfg_breedingseasonend("NEWT_BREEDINGSEASONEND", CFG_CUSTOM, June)
Newt model input parameter - Last possible breeding season date Griffiths et al (2010) & Langton et a...
int SupplyDayInYear(void)
Definition: landscape.h:1596
void SetFreeLivingMortChance()
Calculate the daily background mortality chance based on weather.
Definition: Newt_Population_Manager.cpp:308
void OutputMetamorphosisStats()
Output mean and variance for meatamorphosis times this year.
Definition: Newt_Population_Manager.cpp:481

References cfg_breedingseasonend, cfg_breedingseasonstart, Population_Manager::GetLiveArraySize(), m_BreedingSeasonFlag, Population_Manager::m_TheLandscape, OutputMetamorphosisStats(), SetFreeLivingMortChance(), Landscape::SupplyDayInYear(), Population_Manager::TheArray, tton_Female, and CfgInt::value().

◆ GetEggDDRateTransformation()

double Newt_Population_Manager::GetEggDDRateTransformation ( double  a_temperature)
inline

Returns the value from the precalulated m_NewtEgg_DDTempRate to get effective day degrees.

Uses the precalulated m_NewtEgg_DDTempRate array for speed optimisation. Rounds to the nearest degree.

93  {
97  int temp = int(round(a_temperature));
98  if (temp <= 1) return 0.0;
99  if (temp > 29) return 0.0;
100  return m_NewtEgg_DDTempRate[temp]*a_temperature;
101  }

References m_NewtEgg_DDTempRate.

Referenced by Newt_Egg::st_Develop().

◆ InitOutputMetamorphosisStats()

void Newt_Population_Manager::InitOutputMetamorphosisStats ( )

Initialises output mean and variance for meatamorphosis times this year.

474  {
475  fstream ofile("NewtMetamorphosisDevelStats.txt", ios::out);
476  ofile << "Year" << '\t' << "N" << '\t' << "Mean" << '\t' << "Variance" << '\t' << "EggProduction" << '\t' << "JuvenileProduction" << '\t' << "AdultProduction" << '\t' << "Juveniles" << '\t' << "Adults" << endl;
477  ofile.close();
478 }

Referenced by Newt_Population_Manager().

◆ IsBreedingSeason()

int Newt_Population_Manager::IsBreedingSeason ( )
inline

Returns whether it is breeding season or not.

87  {
88  return m_BreedingSeasonFlag;
89  }

References m_BreedingSeasonFlag.

Referenced by Newt_Female::st_Breed(), Newt_Adult::st_EvaluateHabitat(), and Newt_Female::st_EvaluateHabitat().

◆ OutputMetamorphosisStats()

void Newt_Population_Manager::OutputMetamorphosisStats ( )

Output mean and variance for meatamorphosis times this year.

481  {
482  fstream ofile("NewtMetamorphosisDevelStats.txt", ios::app | ios::out);
488  ofile.close();
489 }
int SupplyYearNumber(void)
Definition: landscape.h:1616
SimpleStatistics m_NewtAdultProdStats
A class for holding the stats on newt adult production.
Definition: Newt_Population_Manager.h:125
SimpleStatistics m_NewtMetamorphosisStats
A class for holding the stats on newt metamorphosis development times.
Definition: Newt_Population_Manager.h:121
SimpleStatistics m_NewtEggProdStats
A class for holding the stats on newt egg production.
Definition: Newt_Population_Manager.h:123
double get_meanvalue()
Returns the mean.
Definition: PopulationManager.h:366
double get_N()
Returns the number of values.
Definition: PopulationManager.h:358
double get_Total()
Returns the mean.
Definition: PopulationManager.h:362
double get_varianceP()
Returns the population variance.
Definition: PopulationManager.h:371
void ClearData()
Clears the data.
Definition: PopulationManager.h:403

References SimpleStatistics::ClearData(), SimpleStatistics::get_meanvalue(), SimpleStatistics::get_N(), SimpleStatistics::get_Total(), SimpleStatistics::get_varianceP(), Population_Manager::GetLiveArraySize(), m_NewtAdultProdStats, m_NewtEggProdStats, m_NewtMetamorphosisStats, Population_Manager::m_TheLandscape, Landscape::SupplyYearNumber(), tton_Female, tton_Juvenile, and tton_Male.

Referenced by DoFirst().

◆ RecordAdultProduction()

void Newt_Population_Manager::RecordAdultProduction ( int  a_adult)

Add a new adult to the stats record.

456  {
457  // A Newt has become juvenile, we need to record this for the statistics
459 }
void add_variable(double x)
Add a value.
Definition: PopulationManager.h:342

References SimpleStatistics::add_variable(), and m_NewtAdultProdStats.

Referenced by Newt_Adult::Init().

◆ RecordEggProduction()

void Newt_Population_Manager::RecordEggProduction ( int  a_eggs)

Add a new egg production to the stats record.

462  {
463  // A Newt has become juvenile, we need to record this for the statistics
465 }

References SimpleStatistics::add_variable(), and m_NewtEggProdStats.

Referenced by CreateObjects().

◆ RecordMetamorphosis()

void Newt_Population_Manager::RecordMetamorphosis ( int  a_age)

Add a new metamorphosis time to the stats record.

468  {
469  // A Newt has become juvenile, we need to record this for the statistics
471 }

References SimpleStatistics::add_variable(), and m_NewtMetamorphosisStats.

Referenced by Newt_Larva::st_NextStage().

◆ SetFreeLivingMortChance()

void Newt_Population_Manager::SetFreeLivingMortChance ( )

Calculate the daily background mortality chance based on weather.

The model for daily newt mortality in free-living stages and out of water is based on Griffiths et al (2010). It assumes survival is inversely releated to rainfall Jun-Feb and minimum winter mean (Dec-Feb). This method calculates the daily probability of survival assuming 270 days of season and 0.0016 reduction for each 1mm rain above 200mm and 0.1 reduction for each 1 degree above -2 during the 90 days of Winter assumed by Griffiths et al (2010). The two survival curves are added and divided by 2 (equal weight and central tendency). Because we use seasonal data we only need to calculate this at the beginning of the season. Initial tests show that extending these relationships outside the range of the original data leads to extreme mortalities and therefore input data is constrained to lie within the maximum bounds of the original data used for the relationships. This daily rate of mortality is applied each day so the overall survival rate per year is transformed to daily probability needed to achieve this.

308  {
320  double survivalchance1 = 0;
321  double survivalchance2 = 0;
322  int today = m_TheLandscape->SupplyDayInYear();
323  if (today == June) {
324  // New season, so calculate the mortalities
325  double mortrainfall = m_TheLandscape->SupplyRainPeriod(g_date->OldDays() + June + 270, 270);
326  if (mortrainfall < 200) mortrainfall = 200;
327  if (mortrainfall > 650) mortrainfall = 650;
328  double morttemp = m_TheLandscape->SupplyTempPeriod(g_date->OldDays() + December + 90, 90) / 90.0;
329  if (morttemp < -2.0) morttemp = -2.0;
330  if (morttemp > 4.0) morttemp = 4.0;
331  survivalchance1 = pow((1.0 - ((mortrainfall - 200)*cfg_NewtNARMortalityFactor.value())), 1.0 / 365.0);
332  survivalchance2 = pow((1.0 - ((morttemp + 2.0)*cfg_NewtWTMortalityFactor.value())), 1.0 / 365.0);
333  // Griffiths et al have an average survival of 0.5, which equates to a mortality of 0.001897 per day.
334  // However, tests indicate that this is just too low for overall population persistance.
335  double mortchance = 1.0 - (((survivalchance1 + survivalchance2) / 2.0) );
336  // Add some annual stochasiticity
337  mortchance = mortchance + (mortchance*g_rand_uni()*2.0) - (mortchance*1.0); // +/-10%
338  Newt_Base::m_JuvenileMortalityChance = mortchance + 0.001;
340  }
341 }
static CfgFloat cfg_NewtNARMortalityFactor("NEWT_NAR_MORTALITYFACTOR", CFG_CUSTOM, 0.0016)
Newt model input parameter - This is the per mm decrease in survival in non-aquatic rainfall (from Gr...
static CfgFloat cfg_NewtWTMortalityFactor("NEWT_WT_MORTALITYFACTOR", CFG_CUSTOM, 0.10)
Newt model input parameter - This is the per degree decrease in survival in winter minimum temp (from...
class Calendar * g_date
Definition: calendar.cpp:38
long OldDays(void)
Definition: calendar.h:60
double SupplyRainPeriod(long a_date, int a_period)
Definition: landscape.h:1351
double SupplyTempPeriod(long a_date, int a_period)
Definition: landscape.h:1410
static double m_JuvenileMortalityChance
Definition: Newt.h:103
static double m_AdultMortalityChance
Definition: Newt.h:104
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
const int June
Definition: landscape.h:41
const int December
Definition: landscape.h:47

References cfg_NewtNARMortalityFactor, cfg_NewtWTMortalityFactor, December, g_date, g_rand_uni, June, Newt_Base::m_AdultMortalityChance, Newt_Base::m_JuvenileMortalityChance, Population_Manager::m_TheLandscape, Calendar::OldDays(), Landscape::SupplyDayInYear(), Landscape::SupplyRainPeriod(), Landscape::SupplyTempPeriod(), and CfgFloat::value().

Referenced by DoFirst().

◆ SetUnsetBreedingSeason()

void Newt_Population_Manager::SetUnsetBreedingSeason ( )
protected

Controls when it is breeding season

◆ TheAOROutputProbe()

void Newt_Population_Manager::TheAOROutputProbe ( )
virtual

Special output functionality.

Reimplemented from Population_Manager.

451  {
453 }
virtual void DoProbe(int a_lifestage)
Definition: AOR_Probe.cpp:59
AOR_Probe * m_AOR_Probe
Definition: PopulationManager.h:526

References AOR_Probe::DoProbe(), Population_Manager::m_AOR_Probe, and tton_Female.

Member Data Documentation

◆ m_BreedingSeasonFlag

int Newt_Population_Manager::m_BreedingSeasonFlag
protected

Set to 0 when it is newt breeding season, then records the number of days after.

Referenced by DoFirst(), IsBreedingSeason(), and Newt_Population_Manager().

◆ m_NewtAdultProdStats

SimpleStatistics Newt_Population_Manager::m_NewtAdultProdStats
protected

A class for holding the stats on newt adult production.

Referenced by OutputMetamorphosisStats(), and RecordAdultProduction().

◆ m_NewtEgg_DDTempRate

double Newt_Population_Manager::m_NewtEgg_DDTempRate[31]
protected

An array to hold a precalulated day-degree rate transformation for egg development.

Referenced by GetEggDDRateTransformation(), and Newt_Population_Manager().

◆ m_NewtEggProdStats

SimpleStatistics Newt_Population_Manager::m_NewtEggProdStats
protected

A class for holding the stats on newt egg production.

Referenced by OutputMetamorphosisStats(), and RecordEggProduction().

◆ m_NewtMetamorphosisStats

SimpleStatistics Newt_Population_Manager::m_NewtMetamorphosisStats
protected

A class for holding the stats on newt metamorphosis development times.

Referenced by OutputMetamorphosisStats(), and RecordMetamorphosis().


The documentation for this class was generated from the following files: